﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using System.Xml.Serialization;
using System.ComponentModel;

namespace ObjectComposition
{
    public class Component
    {
        [XmlIgnore]
		private bool serialize = true;
        public bool Serialize
		{
			get
			{
				return this.serialize;
			}
			set
			{
				this.serialize = value;
			}
		}

		private bool editable = true;
        [XmlAttribute]
        [DefaultValue(true)]
        public bool Editable
		{
			get
			{
				return this.editable;
			}
			set
			{
				this.editable = value;
			}
		}

        protected Main main;

        [XmlIgnore]
        public Entity Entity { get; set; }

        public Component()
        {
        }

        public virtual void InitializeProperties()
        {
        }

        public virtual void SetEntity(Main _main, Entity _entity)
        {
            this.main = _main;
            this.Entity = _entity;
        }

        public virtual void Update(float elapsedTime)
        {
        }

        public virtual void Draw(GameTime time)
        {
        }

        public virtual void Delete()
        {
        }
    }
}
